<%@ page import="com.zjitc.model.User" %>
<%@ page import="java.text.DecimalFormat" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" %>
<html>
<head>
<title>Checkout</title>
<link href="${pageContext.request.contextPath}/cart/css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->

<!-- Custom Theme files -->
<!--theme style-->
<link href="${pageContext.request.contextPath}/cart/css/style.css" rel="stylesheet" type="text/css" media="all" />
<script src="js/jquery.min.js"></script>
  <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css" type="text/css" media="all">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/css/font-awesome.css" type="text/css" media="all">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css" type="text/css" media="all" />


<!--//theme-style-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Wedding Store Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- start menu -->
<script src="${pageContext.request.contextPath}/cart/js/simpleCart.min.js"> </script>
<!-- start menu -->
<link href="${pageContext.request.contextPath}/cart/css/memenu.css" rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript" src="${pageContext.request.contextPath}/cart/js/memenu.js"></script>
<script>$(document).ready(function(){$(".memenu").memenu();});</script>	
<!-- /start menu -->
</head>
<body>
<!-- header -->

<jsp:include page="../top.jsp"/>
<%-- header --%>
<!-- check out -->
<div class="container">
	<div class="check-sec">	 
		<div class="col-md-3 cart-total">
			<a class="continue" href="../index.jsp">Continue to basket</a>

      <form name=alipayment action=${pageContext.request.contextPath}/alipay.trade.page.pay.jsp method=post
            target="_blank">
			<div class="price-details">
        <h3>邮寄地址</h3>
        <a href="#">${address}</a>
				<h3>价格详情</h3>
				<span>商品总价</span>
				<span class="total1">￥${allprice}.00</span>
				<span>快递费</span>
				<span class="total1">￥100.00</span>
				<span>总价</span>
				<span class="total1">￥${allprice+100}.00</span>
        <span>折扣</span>
        <span class="total1">10%(Festival Offer)</span>
				<div class="clearfix"></div>				 
			</div>	
			<ul class="total_price">
			   <li class="last_price"> <h4>最终支付价格</h4></li>
			   <li class="last_price"><span>￥${(allprice+100)*0.9}</span></li>
			</ul> 
			<div class="clearfix"></div>
			<div class="clearfix"></div>
<%--			<a class="order" href="">下订单</a>--%>
            <input type="hidden" id="WIDout_trade_no" name="WIDout_trade_no" />
            <input type="hidden" id="WIDsubject" name="WIDsubject" />
            <input type="hidden" id="WIDtotal_amount" name="WIDtotal_amount" />
            <input type="hidden" id="WIDbody" name="WIDbody" value="小猫卖家" />
        <button class="order" type="submit"
                style="text-align: center;">下订单</button>
      </form>

			<div class="total-item">
				<h3>OPTIONS</h3>
				<h4>优惠券</h4>
				<a class="cpns" href="#">使用优惠券</a>
			</div>
		</div>
		<div class="col-md-9 cart-items">
			<h1>我的购物袋(${count})</h1>
				<script>$(document).ready(function(c) {
					$('.close1').on('click', function(c){
						$('.cart-header').fadeOut('slow', function(c){
							$('.cart-header').remove();
						});
						});	  
					});
			   </script>

          <c:forEach var="c" items="${catlist}" varStatus="status">

    <div class="cart-header">
      <button href="/cart/remove.do?id=${c.id}" class="close1"></button>
      <a class="close1" href="/cart/remove.do?id=${c.id}"></a>
      <div class="cart-sec simpleCart_shelfItem">
        <div class="cart-item cyc">
          <img src="${pageContext.request.contextPath}/${c.image}" class="img-responsive" alt=""/>
        </div>
        <div class="cart-item-info">
          <h3><a href="">${c.catSpecies}</a><span>猫咪编号: ${c.id}</span></h3>
          <ul class="qty">
            <li><p>生日 : ${c.birthday}</p></li>
            <li><p>价格 : ${c.price}</p></li>
          </ul>
          <div class="delivery">
            <p>快递费 : ￥100.00</p>
            <span>在2-3个营业日内交付</span>
            <div class="clearfix"></div>
          </div>
        </div>
        <div class="clearfix"></div>

      </div>
    </div>


        </c:forEach>



			 <script>$(document).ready(function(c) {
					$('.close2').on('click', function(c){
							$('.cart-header2').fadeOut('slow', function(c){
						$('.cart-header2').remove();
					});
					});	  
					});
			 </script>

		</div>
		<div class="clearfix"> </div>
	</div>
</div>
<!-- //check out -->
<%int price = (int) session.getAttribute("allprice");
double reallyPay =((price+100)*0.9);
  DecimalFormat df = new DecimalFormat("#.00");
df.format(reallyPay);
%>
<jsp:include page="../footer.jsp"/>
<script language="javascript">
  var tabs = document.getElementsByName('tab');
  var contents = document.getElementsByName('divcontent');

  (function changeTab(tab) {
    for(var i = 0, len = tabs.length; i < len; i++) {
      tabs[i].onmouseover = showTab;
    }
  })();

  function showTab() {
    for(var i = 0, len = tabs.length; i < len; i++) {
      if(tabs[i] === this) {
        tabs[i].className = 'selected';
        contents[i].className = 'show';
      } else {
        tabs[i].className = '';
        contents[i].className = 'tab-content';
      }
    }
  }

  function GetDateNow() {
    var vNow = new Date();
    var sNow = "";
    sNow += String(vNow.getFullYear());
    sNow += String(vNow.getMonth() + 1);
    sNow += String(vNow.getDate());
    sNow += String(vNow.getHours());
    sNow += String(vNow.getMinutes());
    sNow += String(vNow.getSeconds());
    sNow += String(vNow.getMilliseconds());
    document.getElementById("WIDout_trade_no").value =  sNow;
    document.getElementById("WIDsubject").value = "CatShop";
    document.getElementById("WIDtotal_amount").value = <%=reallyPay%> +
        "";
  }
  GetDateNow();
</script>



<!---->
</body>
</html>